www.gusucode.com > 深度学习(asp)网址导航 v4.0.1 > 深度学习(asp)网址导航 v4.0.1\code\admin\dataManage\data_Restore.asp

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
projectRootPath = "../../"	'相对当前应用程序根的位置
%>
<!-- #include file ="../include/checkPurview.asp"-->
<!--#include file="../../ConnDB.asp"-->
<!-- #include file="../include/Function.Manage.Config.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="robots" content="noindex,nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>数据管理</title>
<link rel="stylesheet" type="text/css" href="../themes/base.css"/>
    <link href="../themes/<%=theme_Path%>/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function check(){
	if (form1.bkDBpath.value==""){
		alert("备份数据库路径不能为空!!");
		form1.bkDBpath.focus();
		return false;
	}
	if (form1.restorePath.value==""){
		alert("备份数据库路径不能为空!!");
		form1.restorePath.focus();
		return false;
	}
	
}
</script>
</head>

</head>
<body  id="bodyBg1">
<br />
&nbsp; <a href="data_Restore.asp">恢复数据库</a>
<hr class="Nav-hr" />
<br />
<dl class="manageContent">
    <dt>恢复数据库</dt>
    <dd>
    	<br />
<%
if request("action")="Restore" then
	bkDBpath=request.form("bkDBpath")
	restorePath=request.form("restorePath")
	if bkDBpath="" then
		errmsg="<li>请输入备份数据库路径全名。"
		response.Write errmsg
	else
		bkDBpath=server.mappath(bkDBpath)
	end if
	if restorePath="" then
		errmsg="<li>请输入目标数据库路径全名。"
	else
		restorePath=server.mappath(restorePath)
	end if
	'Response.write restorePath
	Set Fso=server.createobject("scripting.filesystemobject")
	if fso.fileexists(bkDBpath) then  					
		fso.copyfile bkDBpath,restorePath
		errmsg="<li>成功恢复数据!"
		response.Write errmsg		
	else
		errmsg="<li>备份目录下并无您的备份文件!"
		response.Write errmsg
	end if
	response.write "<br><br><input type=button value=' 返 回 ' class=tbutton onclick=javascript:history.go(-1)>"

else
%>
  <form action="" name="form1" method="post" onsubmit="return check()">
	  &nbsp;&nbsp;<B>恢复数据</B>( 需要FSO支持,FSO相关帮助请看微软网站 )<br />
	  &nbsp;&nbsp;备份数据库路径(相对):
        <input type="text" size="30" name="bkDBpath" value="DataBackup\data_backup.mdb" />
        <br />
		&nbsp;&nbsp;目标数据库路径(相对):
              <input type="text" size="30" name="restorePath" value="<%=DBpath%>" /><br />
        &nbsp;&nbsp;填写您当前使用的数据库路径,如不想覆盖当前文件,可自行命名(注意路径是否正确),然后修改conn.asp文件,如果目标文件名和当前使用数据库名一致的话,不需修改conn.asp文件<br />
		&nbsp;&nbsp; <input type="submit" value="恢复数据" /><br />
		<hr />
        &nbsp;&nbsp;在上面填写本程序的数据库路径全名,本程序的默认备份数据库文件为DataBackup\data_backup.mdb,请按照您的备份文件自行修改。<br />
  		&nbsp;&nbsp;您可以用这个功能来备份您的法规数据,以保证您的数据安全!<br />
  		&nbsp;&nbsp;注意:所有路径都是相对与程序空间根目录的相对路径
		<input type="hidden" name="action" value="Restore" />
	</form>
<%end if%>
   
<%

Call CloseConnDB()
%>
        <br />
    </dd>
</dl>
<br />
</body>
</html>